# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-sha3
pkgname=('python2-sha3' 'python-sha3')
_pkgname=sha3
pkgver=0.2.1
pkgrel=9
pkgdesc='SHA-3 implementation for Python.'
arch=('x86_64' 'aarch64')
url='https://pypi.org/project/sha3/#files'
license=('custom:unknown')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('13a0e52fb14c1a640d736781084963d0b26bab3d20864911e6446c0d87b422f1b943b224c35cb59410ca322da6c2e167a6638ff339b57c178c2f01f28f00d306')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-sha3() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-sha3() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

